Apparatus for controlling a virtual environment

ABSTRACT

An apparatus for controlling an interactive virtual environment is disclosed. The apparatus comprises means for defining a virtual environment populated by objects, the objects comprising at least avatars and props, objects within the virtual environment may be dynamically attached to and detached from other objects under user control. A prop has associated with it an animation for use when an avatar interacts with the prop, and when the prop is attached to another object the animation remains associated with the prop. When an object is attached to another object, it may inherit the movement of the object to which it is attached.

The present invention relates to an apparatus for controlling a virtualenvironment, and in particular an interactive virtual environment whichmay be populated by avatars and props. Such an apparatus can be used,for example, as an authoring tool for allowing a user to create and editanimation sequences, or in games.

In conventional computer animation systems, an animator creates a seriesof movements in a scene frame by frame. Alternatively the animator maycreate a series of keyframes, in which case the system automaticallycreates the intermediate frames to produce a linear animation sequence.In such systems the process of creating an animation sequence is slowand expensive due to the need to employ a skilled animator to create theframes or keyframes.

Alternative computer animation systems have therefore been proposed inwhich animation sequences can be produced by a user controlling avirtual environment interactively and by extensive re-use ofpre-existing animations stored within the system. In such systems, avirtual environment is created which may be populated by avatars, propsand other objects. Animations are made available which determine the wayin which the objects move in the virtual environment. These may beimported directly from motion capture rigs, created in other3D-animation packages or exist in the library of motions included withthe software. By controlling the virtual environment, a user can buildup an animation sequence for later replay or editing.

Interactive virtual environments are also used in many computer games.Such games usually display a virtual world populated by characters andother objects. The characters may move through the virtual world andperform actions such as picking up an object. In such games animationsequences are created in response to a user's input, but no provision ismade to save the animation sequence for replay or for editing.

A problem which arises when creating an interactive virtual environmentis that, due to its interactive nature, it is difficult to ensure thatthe integrity of the environment will be maintained in all possiblesituations. This problem is usually overcome by predicting all possiblesituations which may arise, and ensuring that an animation is availablefor each situation. For example, a character entering a room may need tointeract with an object within the room. The designer will then need tocreate a bespoke animation for the character to go to each potentialplace where the object might be. The complexity of such animations andworkload involved in creating them mean that only a small set ofpossible options are normally created for a given situation. Theanimations give the impression of free choice but, in fact, a treestructure of options is worked through.

If an object or choice within a scene was not considered by thedesigners of the scene then the environment may crash or fail to allowthe user to continue as there is no pre-determined way for the user toget to the object, make the choice etc.

Interaction with objects also introduces complexity in terms of thenumber of potential objects. For example, if an avatar is able to pickup and put down a prop, then the system must be able to cope with theavatar both with and without the prop. This is traditionally done bypredicting all possible combinations of objects which may arise, andensuring that an animation is available for each possible combination.This can be done by providing separate animations of the avatar with andwithout the prop and cutting from one to the other when the prop ispicked up or put down. Such an arrangement requires a large amount ofanimation to be produced in advance and stored ready for use.Furthermore the need to animate all possible combinations of objects inadvance limits the number of objects that can be linked.

Alternatively a bit map image of the prop may be overlaid on the avatarwhen the avatar picks up the prop. In this case the appearance of theavatar is altered so that it appears as a combination of the avatar andthe prop. The prop and the avatar movement need to be coordinated sothat the interaction with the prop appears realistic, although both propand avatar are actually having their movements controlled separatelywithin the system. This arrangement has the disadvantage that it isdifficult to maintain the integrity of the environment, as the systemhas to include provision for remembering the positioning of all theprops and ensuring they are only interacted with in positions that haveanimations created for that position.

According to a first aspect of the present invention there is providedapparatus for controlling an interactive virtual environment, theapparatus comprising means for defining a virtual environment populatedby objects, the objects comprising at least avatars and props, wherein:

objects within the virtual environment may be dynamically attached toand detached from other objects under user control; and

a prop has associated with it an animation for use when an avatarinteracts with the prop, and when the prop is attached to another objectthe animation remains associated with the prop.

Associating the animation with the prop in this way effectively attachesthe animation to other objects together with the prop, which can help tomaintain the integrity of the virtual environment. This is because theanimation moves around the virtual environment together with the prop,and therefore the necessary animations for an interaction between anavatar and the prop will always be available.

Furthermore, the association of animation to the prop can allow majorchanges to take place in a scene without affecting the integrity of thescene. For example, if an environment were playing a scene, then a propwith an animation associated with it could be dropped into the scene andimmediately all avatars would be able to interact with it because theprop in this system contains the information defining the interaction.

The term “avatar” as used herein preferably means an autonomous object,by which is preferably meant that the object can move independently,either of its own accord or under user control. An avatar is typically acharacter in a scene, but may also be any vehicle or other object thatinteracts with other avatars, objects or parts of the scenery. An avatarmay be given a certain appearance and behaviour, and may be controlledby the user.

The term “prop” as used herein preferably means a non-autonomous object,by which it is preferably meant that the object can only move independence on another object or under user control. A prop may howeverhave its own animations; for example a clock may have a pendulum whichswings and hands which move, although the clock itself cannot move orgenerate interactions with other props of its own accord.

Preferably, when an object is attached to another object, it inheritsthe movement of the object to which it is attached. By allowing objectsto be dynamically attached and detached to other objects, and arrangingfor an object that is attached to another object to inherit the movementof that object, it is possible for one object to be carried by anotherobject without having to provide separate animations for thatcombination of objects in advance or separate coordination of themovement of the carried object. This leads to a much more flexiblesystem in which it is not necessary to predict all possible combinationsof objects and placements in advance.

The apparatus may further comprise means for storing an animationsequence for subsequent replay or editing, and/or the apparatus may bean apparatus for playing a computer game.

The concept of motion inheritance within an authoring tool for creatingand editing animation sequences is an important aspect of the presentinvention which may be provided independently. Thus, according to asecond aspect of the present invention there is provided an apparatusfor controlling an interactive virtual environment, the apparatuscomprising:

means for defining a virtual environment populated by objects;

means for allowing a user to control the virtual environment to createan animation sequence; and

means for storing an animation sequence for subsequent replay orediting;

wherein objects within the virtual environment may be dynamicallyattached to and detached from other objects, and when an object isattached to another object it inherits the movement of the object towhich it is attached.

In the second aspect of the invention the objects may comprise at leastavatars and props. A prop may have associated with it an animation foruse when an avatar interacts with the prop.

The concept of associating an animation with a prop in an authoring toolis another important feature of the present invention which may also beprovided independently. Thus, according to a third aspect of theinvention there is provided apparatus for controlling an interactivevirtual environment, the apparatus comprising:

means for defining a virtual environment populated by objects, theobjects comprising at least avatars and props;

means for allowing a user to control the virtual environment to createan animation sequence; and

means for storing an animation sequence for subsequent replay orediting;

wherein a prop has associated with it an animation for use when anavatar interacts with the prop.

Preferably, when the prop is attached to another object, the associatedanimation remains associated with the prop.

In any of the above aspects, the animation which is associated with theprop may be an animation defining the movement of the avatar, or ananimation defining the movement of the prop. Where appropriate, the propmay have associated with it an animation defining the movement of theprop and an animation defining the movement of the avatar when theavatar interacts with the prop. For example opening a door requires ananimation for the prop (the door) and a coordinated animation for theavatar (opening the door). The combination of both animations providesthe impression that the avatar is opening the door. In othercircumstances only an avatar animation or only a prop animation isnecessary; for example turning on a television might have a motion forthe avatar but not for the television itself, since the television doesnot move.

When an avatar interacts with the prop, the avatar may query the propfor the avatar animation associated with the prop.

The animation or animations may be defined as part of a state machineassociated with the prop. The state machine may comprise a statetransition which defines an initial state, a final state, and at leastone of a prop animation which takes the prop from the initial state tothe final state, and an avatar animation which takes the avatar from theinitial state to the final state, and possibly back to the initialstate. In many situations both a prop animation and an avatar animationwill be provided. However, where either the prop or the avatar does notmove during an interaction, then no animation need be provided for thatobject. For example, if the prop is a staircase, then the avataranimation may define the movement of the avatar up or down thestaircase, but no prop animation need be provided. The state machine maycomprise a plurality of state transitions each of which defines one wayin which an avatar interacts with the prop.

A precondition may be associated with one of the states. Such aprecondition may require an avatar to perform one action before anotheraction is performed, as the precondition defines that a prop must be ina certain state before another action is carried out. This can allowrelatively complex and flexible sequences to be built up as the currentstate of props and any preconditions define how the avatar will interactwith the props, allowing sophisticated chains of movement to be built upusing simple commands.

The state machine may have an idle state. The idle state may be a stateinto which an avatar enters following a particular action. There mayalso be an action which takes the avatar out of the idle state, and theavatar may be required to perform this action before any further actionis performed. This arrangement can also allow relatively complexbehaviours to be built up.

An animation sequence may be stored as a script comprising a list ofcommands. Such commands may be the same commands as may be entered by auser in order to control the virtual environment. This may provide aconvenient way of storing complex behaviours, which is easily understoodby a user.

The script may be typed in by the user through a script window, or thescript may be created by recording the commands which a user types inwhile controlling the virtual environment. Scripts may be nested, andscripts may call other scripts. This can allow complex behaviours to bebuilt up using behaviours that have already been created.

A script may contain an instruction which is to be passed to an objectin the virtual environment. The apparatus may be arranged such that theinstruction is only passed to the object once an animation whichprecedes it in the script has been played out. This can help to ensurethat the integrity of the environment is maintained, by ensuring that ananimation which is in progress is completed before another animationstarts.

An animation sequence may also be built up using first person control ofthe avatars. This uses keyboard buttons and/or the mouse to control themovement of the avatar in the environment and its interaction with otheravatars and props. This can be recorded and then replayed with furthermotions or interactions being overlaid on the existing motions andinteractions recorded previously. This layered animation can be savedand called from within a script creating a hybrid of script and firstperson control based animation.

An avatar may comprise at least a file defining its appearance, and ananimation defining its movements. A plurality of avatars may share acommon animation. Such an animation may be either an animation which isassociated with the avatar, or an animation which is associated withanother object such as a prop. This can increase the flexibility of thesystem and reduce the amount of animation that needs to be created.Where the avatars are different sizes, or where the common animation hasbeen created for an avatar which is a different size, the commonanimation may be retargeted to fit the size of the avatar in question.

A prop may include a file which specifies a way in which the prop maycontain other props. This can allow the system to handle the situationwhere one prop is placed inside another while maintaining the integrityof the environment.

Corresponding method aspects are also provided, and thus according to afourth aspect of the present invention there is provided a method ofcontrolling an interactive virtual environment, the method comprisingdefining a virtual environment populated by objects, the objectscomprising at least avatars and props, wherein:

objects within the virtual environment may be dynamically attached toand detached from other objects under user control; and

a prop has associated with it an animation for use when the propinteracts with an avatar, and when the prop is attached to anotherobject the associated animation remains associated with the prop.

According to a fifth aspect of the present invention there is provided amethod of controlling an interactive virtual environment, the methodcomprising the steps of:

defining a virtual environment populated by objects, wherein objects maybe dynamically attached to and detached from other objects;

allowing a user to control the virtual environment to create ananimation sequence; and

storing an animation sequence for subsequent replay or editing;

wherein when an object is attached to another object it inherits themovement of the object to which it is attached.

According to a sixth aspect of the invention there is provided a methodof controlling an interactive virtual environment, the methodcomprising:

defining a virtual environment populated by objects, the objectscomprising at least avatars and props;

allowing a user to control the virtual environment to create ananimation sequence;

storing an animation sequence for subsequent replay or editing; and

associating with a prop an animation for use when an avatar interactswith the prop.

The invention also provides a computer program which, when run on acomputer, causes the computer to carry out the method of any of fourthto sixth aspects, or to become the apparatus of any of the first tothird aspects. The invention also provides a computer readable storagemedium having stored thereon a computer program which, when run on acomputer, causes the computer to carry out the method of any of thefourth to sixth aspects or to become the apparatus of any of the firstto third aspects.

The invention may also provide apparatus for controlling an interactivevirtual environment, the apparatus comprising a processor, a memory, aninput device and a display device, wherein the processor is programmedsuch that:

a virtual environment populated by objects is defined for display on thedisplay device;

a user may control the virtual environment by means of the input deviceto create an animation sequence and save an animation sequence in thememory for subsequent replay or editing; and

objects within the virtual environment may be dynamically attached anddetached to and from other objects, and when an object is attached toanother object it inherits the movement of the object to which it isattached.

The invention may also provide apparatus for controlling an interactivevirtual environment, the apparatus comprising a processor, a memory, aninput device and a display device, wherein the processor is programmedsuch that:

a virtual environment populated by objects is defined for display on thedisplay device, the objects comprising at least avatars and props;

a user may control the virtual environment by means of the input deviceto create an animation sequence and save an animation sequence in thememory for subsequent replay or editing; and

a prop has associated with it an animation for use when the propinteracts with an avatar.

The invention may also provide apparatus for controlling an interactivevirtual environment, the apparatus comprising a processor, a memory, aninput device and a display device, wherein the processor is programmedsuch that:

a virtual environment populated by objects is defined for display on thedisplay device, the objects comprising at least avatars and props;

objects within the virtual environment may be dynamically attached anddetached to other objects under user control, and when an object isattached to another object it inherits the movement of the object towhich it is attached; and

a prop has associated with it an animation for use when an avatarinteracts with the prop, and when the prop is attached to another objectthe associated animation remains associated to the prop.

Features of any of the above aspects may be applied to any of the otheraspects. Apparatus features may be applied to the method aspects andvice versa.

Preferred features of the present invention will now be described,purely by way of example, with reference to the accompanying drawings,in which:—

FIG. 1 shows an editing apparatus according to an embodiment of thepresent invention;

FIG. 2 shows an example of the steps which may be taken in order tocreate a virtual environment;

FIG. 3 shows an example of the various components that may make up avirtual environment;

FIG. 4 shows an example of the composition of an avatar;

FIG. 5 shows an example of the composition of a prop;

FIG. 6 shows an example of a graphical user interface produced by theediting apparatus of FIG. 1;

FIGS. 7A to 7C show examples of scene hierarchies; and

FIG. 8 shows an example of a state machine.

OVERVIEW OF AN EDITING APPARATUS

FIG. 1 of the accompanying drawings shows an editing apparatus 1according to an embodiment of the present invention. In this embodimentthe editing apparatus is implemented using a suitably programmed generalpurpose computer. Referring to FIG. 1, computer 10 comprises centralprocessing unit (CPU) 12, solid state memory 14, hard disk 16, interface18 and bus 20. The memory 14 stores an authoring tool program 24 forexecution by the CPU 12 and data representing a virtual environment 25.The hard disk 16 stores four different types of files, namely binaryfiles 26, floor plan files 28, virtual world files 30 and behaviourfiles 32. The computer 10 is connected to an external display 22 and aninput device 23 such as a keyboard and/or mouse. The computer 10 is alsoconnected to linear animation system 34.

The binary files 26 are files which contain low level geometric andanimated data, and the floor plan files 28 are files which represent thefloor plan of the virtual environment. In the present embodiment, thebinary files 26 and the floor plan files 28 are created by the linearanimation system 34 and exported to the editing apparatus 1. The binaryfiles 26 and floor plan files 28 are then used as building blocks by theediting apparatus to create an interactive virtual environment. Thevirtual world files 32 are text files which are created by the editingapparatus 1 and which define the virtual world. The behaviour files 32are also created by the editing apparatus 1, and are text files thatscript the behaviour of the virtual world.

Linear animation system 34 may be, for example, 3D Studio Max(trademark) which is supplied by the company Discreet of the UnitedStates, or any other suitable system for producing geometric andanimated data. Such linear animation systems are known in the art andaccordingly a detailed description thereof is omitted. While in FIG. 1the linear animation system 34 is shown as being external to thecomputer 10, it may be implemented as a program which is run on thecomputer 10. In that case the linear animation system 34 can save thebinary files 26 and the floor plan files 28 directly to the hard disk16.

It will be appreciated that the arrangement of FIG. 1 is given as anexample only and that other arrangements may be used to carry out thepresent invention. For example, some or all of the files 26 to 32 may bestored in memory 14, and some or all of the program 24 may be stored inthe hard disk 16. Other types of storage media such as optical storagemedia may be used as well as or instead of hard disk 16. While FIG. 1shows a general purpose computer configured as an editing apparatus,embodiments of the present invention may be implemented using adedicated editing apparatus.

Creating a Virtual Environment

FIG. 2 shows an example of the steps which may be taken in order tocreate a virtual environment. In step 50, binary files 26 and floor planfiles 28 are created by linear animation system 34. The binary files 50may contain various types of data, such as:

rigid geometry

rigid morph geometry

skinned geometry

skinned morph geometry

keyframe

animation

vertex animation

morph animation

The floor plan files are text files which represent the floor plan of aroom.

In step 52 the binary files and floor plan files are exported to theediting apparatus 1. As a result of this step, binary files 26 and floorplan files 28 are stored on hard disk 16.

In step 54 the editing apparatus 1 loads and edits scenic data whichdefines the appearance of the virtual environment. This is done byloading the required floor plan files 28 and/or binary files 26 from thehard disk 16 and storing them in memory 14. The scene defined by thescenic data is displayed on the display 22, and the user can modify thescene as required through input device 23.

In step 56 objects are created which populate the virtual world definedby the scenic data. The objects may be avatars, props, sounds, camera,lights or any other objects. The objects are created by loading therequired binary files 26 from the hard disk 16 and storing them inmemory 14. As the objects are created, the relationship between thevarious objects (if any) is also defined. The relationship of allobjects to each other is known as the scene hierarchy, and this scenehierarchy is also stored in memory 14.

Once steps 50 to 56 have been completed, a virtual environment populatedby objects such as avatars and props has been created. In step 58 thisvirtual environment is saved as a set of virtual world files 30 on thehard disk 16.

While steps 50 to 56 are shown as taking place sequentially in FIG. 2,in practice the process of building up a virtual world is likely toinvolve several iterations of at least some of the steps in FIG. 2.

FIG. 3 shows an example of the various components that may make up avirtual environment. In this example, the virtual environment 60comprises scenic data 61, two avatars 62, 63, three props 64, 65, 66,two lights 67, 68, two sounds 69, 70, two cameras 71, 72 and scenehierarchy data 73. The files which make up the virtual environment 60are usually stored in memory 14, which allows those files to be accessedas quickly as possible. However memory 14 may instead contain pointersto the relevant files in hard disk 16. This may be done, for example,for files which are rarely used, or if there is insufficient space inmemory 14.

FIG. 4 shows an example of how an avatar, such as one of the avatars 62,63 in FIG. 3, is constructed. Referring to FIG. 4, avatar 100 is made upof geometry file 102, rest file 104, walks file 106, directed walks file108, idle bank 110 and animation bank 112. Each of these files is loadedfrom the hard disk 16 in response to an instruction from the user, orelse a pointer to the appropriate file on the hard disk is created.

The geometry file 102 is a binary file which defines the geometry of theavatar. More than one geometry file can be defined should it be requiredto change the geometry of the avatar. The rest file 104 is a keyframe ofthe avatar in the rest state, and is also a binary file. The walks file106 is a binary file containing animations of the avatar walking. Thedirected walks file 108 contains animations which can be used to allow auser to control the movement of the avatar, for example by means of thecursor control keys on the keyboard. The idle bank 110 is a set ofanimations which the avatar can use when in the rest state, for example,a set of animations which are appropriate for the avatar when it isstanding still. The animation bank 112 is a set of animations which theavatar uses to perform various actions.

FIG. 5 shows an example of how a prop, such as one of the props 64, 65,66 in FIG. 3, is constructed. Referring to FIG. 5, prop 120 comprisesgeometry file 122, state machine 124, grasping file 126, containers file128, speed file 130 and expand file 132.

The geometry file 122 is a binary file which defines the geometry of theprop. The state machine 124 defines how the prop interacts with avatars.The grasping file 126 is one or more keyframe consisting of an avatarattached to the prop, frozen at the instant in time when the avatar ispicking up the prop. The speed file 130 specifies the speed with whichthe prop may move over the floor plan. The expand file 132 defines theexpansion or contraction of the projection of the prop on the floorplan. The cyclic animation file 134 contains animations which may beused to animate the prop as it moves.

The containers file 128 specifies the ways in which a prop may containother props. This file holds a list of floor plan files. Each floor planfile represents a surface on the prop that an avatar uses to positionother props. The prop keeps track of what it contains and what it cancontain and instructs the avatar accordingly.

Sounds, lights, cameras and other objects can be created by the editingtool 1 in a similar way.

All objects can be copied and pasted. Wherever appropriate copiedobjects share geometry and animations (i.e instances of the objects arecreated). When copying and pasting multiple objects the relationshipsbetween those objects are also cloned. For example, a single house maybe built into an apartment block, and if an avatar can navigate itselfaround the house then it will automatically be able to navigate aboutthe apartment block.

In the editing apparatus 1 of FIG. 1, different avatars of differentsizes and different topologies all share a common pool of animations. Ananimation for one particular avatar can be retargeted to a differentavatar. For example, a plurality of different avatars going up a set ofstairs can all share the same animation associated with the stairs.

When an avatar plays an animation, that animation is retargeted to fitthe avatar in question. This is done by extrapolating the animation sothat the nodes of the avatar sweep out movements corresponding to thoseof the original animation, but increased or decreased in magnitude so asto fit the size of the avatar. This technique is known as motionretargeting. If motion retargeting was not used, it would be necessaryto provide a separate animation for each avatar.

Controlling a Virtual Environment

The virtual environment which is created in the way described above isan interactive virtual environment which can be controlled by a user.This is done by displaying a graphical user interface on the display 22of FIG. 1, via which commands can be entered by means of input device23. An example of such a graphical user interface is shown in FIG. 6.

In the example shown in FIG. 6, four windows are display, namely a filelist window 140, a character window 142, a scene window 144 and abehaviour console 146. The file list window 140 lists files stored inone or more directories on the hard disk 16. The character window 142shows a view of an avatar that is being controlled. The scene window 144shows a scene which is being edited and which may contain the avatarshown in the character window 142. The behaviour console 146 is used toinput commands via input device 23. It will be appreciated that otherwindows may also be present and that windows may be opened or closed asrequired.

The editing apparatus 1 uses a scripting language which gives the userhigh-level control over objects within a scene. When creating thebehaviour of the virtual world, the user types in commands through thebehaviour console. For example, commands may be typed in which:

direct objects in the scene

add or remove objects

attach or detach objects to or from other objects

hide or unhide objects

query the scene for information.

All of the commands in the scripting language are dynamic, and can beinvoked at any time during a simulation.

Once the user is satisfied with the results, behaviours are encapsulatedby grouping commands into behaviour files 32 which are stored on harddisk 16. With the exception of query commands, any commands which can beinput through the behaviour console can also be put into a behaviourfile. These behaviour files are also known as scripts.

Behaviour files can be created either by typing in a list of commandsthough a behaviour script window, or else by recording the action whichtakes place in a scene. Action in a scene can be recorded through theuse of a record button which is part of the graphical user interfacedisplayed on display 22. Action can be recorded either through thescene's view window, or else through a camera's view window. Whilerecord button is activated all action that takes place in the virtualenvironment is automatically saved to disk. The thus recorded action canbe converted into an animation file such as an AVI file eitherimmediately or at a later stage.

Complex behaviours can be achieved by running many behaviour filesconcurrently. Behaviour files can be nested. Behaviour files can alsocontrol when other behaviour files get invoked or discarded (so-calledmeta-behaviours).

Complex motion can be built up along the timeline by concatenatinganimation clips from separate sources and blending between them (“motionchaining”).

Dynamic Hierarchy Switching

Objects which make up the virtual environment have a scene hierarchy. Ifan object is the child of another object then it inherits that object'smotion. For example, if a prop is being carried by an avatar, then theprop inherits the motion of the avatar.

Dynamic hierarchy switching occurs when an object changes its parentfrom one object to another. For example, if a prop is given by oneavatar to another, then the prop changes its parent from the firstavatar to the second.

FIGS. 7A to 7C show examples of scene hierarchies. In these figures thescene is populated by one avatar and three props. The avatar is acharacter and the three props are a table, a chair and a glass.

In FIG. 7A it is assumed that the character, the table and the chair areall located independently of each other. These objects thus have onlythe environment as their parent, and so their movement is not dependenton the movement of any other object. It is also assumed that the glassis located on the table. FIG. 7A therefore shows the glass with thetable as its parent. Because of this parent/child relationship, when thetable moves, the glass will move with it.

FIG. 7B shows the scene hierarchy which may occur if the character sitson the chair. This action may be carried out, for example, in responseto a “sit” command which is issued by the user through the behaviourconsole. In FIG. 7B the character is now the child of the chair, whichmeans that if the chair should move then the character will move withit.

FIG. 7C shows the scene hierarchy which may occur if the character picksup the glass from the table. In moving from FIG. 7B to FIG. 7C, theglass dynamically switches its hierarchy so that it is now the child ofthe character, which is itself the child of the chair. The glass willtherefore move in dependence on the movement of the character, whichmovement may itself depend on the movement of the chair.

Dynamic hierarchy switching allows complex movements to be built up inwhich objects interact with each other in a way which appears natural.Without dynamic attachment it would be necessary to provide separateanimations for all anticipated situations where the movement of oneobject was dependent on that of another object.

An avatar is made up of a series of nodes which are linked in a nodehierarchy to form a skeleton. In a simple case an avatar may have a nodehierarchy consisting of two hands, two feet and a head node; in morecomplex cases the node hierarchy may include nodes for shoulders,elbows, fingers, knees, hips, eyes, eyelids, etc.

When an avatar picks up a prop, the prop becomes attached to one of thenodes in the avatar's node hierarchy. For example, if an avatar grasps abottle in its right hand, then the bottle becomes attached to the righthand node. However, since the avatar will usually occupy a certainvolume around its nodes, the prop is not attached directly to the node,but rather, a certain distance is defined from the node to the propcorresponding to the volume occupied by the avatar at the point ofattachment. In addition the orientation of the prop relative to the nodeis defined. The distance and orientation of the prop relative to thenode are then stored.

Once a prop has become attached to an avatar, the prop inheritsmovements of the node to which it is attached. For example, if theavatar plays out an animation, then the movements of each of the nodeswill be defined by the animation. The movement of the prop can then bedetermined, taking into account the distance of the prop from the nodeand its orientation.

A prop can be attached to any one or more of an avatar's nodes; forexample an article of clothing may be attached to several nodes. Inaddition props which define the avatar's appearance can be attached tothe avatar; for example eyes, ears or a nose can be attached to theavatar in this way.

Other objects can be attached to each other in a similar way.

Intelligent Props

In the editing apparatus 1 of FIG. 1, the way in which an avatarinteracts with a prop is defined by a state machine which is associatedwith the prop. The state machine contains one or more animations whichare used to take the avatar and the prop from one state to another. Whenan avatar interacts with a prop, the avatar queries the prop for theanimations that the avatar is to perform.

FIG. 8 shows an example of a state machine which is attached to a prop.In FIG. 8, state machine 150 comprises prop initial state 152, statetransitions 154, 156 and idle bank 158. The prop initial state 152defines the initial state of the prop, and all animations in the statemachine are imported relative to the prop in this initial state. This isdone to ensure that all animations are compatible with the environment.

Each of the state transitions 154, 156 defines the way in which a propand an avatar are taken from one state to another when they interact. Ingeneral, a state transition specifies an initial state and a finalstate, and contains an avatar animation and a prop animation which takethe avatar and the prop from the initial state to the final state.However, where either the prop or the avatar does not move during aninteraction, one of the animations may be omitted. In the most simplecase an avatar interacts with a prop in the same way every time andleaves the prop exactly as it finds it. In this case the prop has onlyone state and there is no state transition as such.

The idle bank 158 defines animations which can be carried out by anavatar when the avatar is interacting with the prop and is in an idlestate.

When an avatar interacts with a prop it queries the prop for the avataranimation. The avatar is then animated with the avatar animation whilethe prop is animated with the prop animation.

The state machine 150 is associated kinematically with the prop. Thismeans that the state machine is attached to the prop and as the propmoves so does the state machine. Associating the state machine with theprop in this way decentralizes control of the animation and leads to avery open architecture. For example a user may introduce his own propinto the environment and, as long as the state machine for the prop iscorrectly set up, that prop will be able to interact with the rest ofthe environment.

When the prop's hierarchy changes, that is, when the prop switches itsparent from one object to another, the state machine associated withthat prop also changes its hierarchy in the same way. Changing the statemachine's hierarchy together with the prop's helps to maintain theintegrity of the virtual environment. This is because the necessaryanimations for an interaction between an avatar and the prop will alwaysbe available, and those animations will always depend on therelationship of the prop to other objects.

Props with state machines can have preconditions applied to states. Ifan avatar is given a command that will result in a prop transitioning toa certain state and this state has preconditions specified, then theavatar will attempt to satisfy the preconditions before executing thecommand. In this way relatively complex behaviours can be generated bycombining a few props and their state machines.

For example, a precondition might be that an avatar cannot put a bottleinto a fridge unless the fridge door is open. In this case, if theavatar is asked to perform the action of putting the bottle into thefridge, it will first attempt to open the fridge door.

A state machine may have an idle state. State machines with idle statesare used when there is a transition required to start the interaction,whereupon the prop goes into the idle state, and a transition to end theinteraction, which takes the prop out of its idle state. If an avatar isgiven a command but is already in the idle state with respect to anotherprop then the system will attempt to take this prop out of its idlestate before executing the command.

For example, if an interaction involves an avatar going to bed, then ananimation may be played that starts with the avatar standing by the bedand ends with it lying on the bed. The state of the avatar lying on thebed may be specified as an idle state. In this state the idle bank forthe avatar may contain animations, for example, corresponding todifferent sleeping movements. If the avatar is then instructed tointeract with another object elsewhere, it must first get out of bed.This will happen automatically if there is a transition corresponding toit getting out of bed whose initial state is set to the idle state.

Deferred Message Passing

Avatars can communicate with other avatars and affect each other'sbehaviours thorough message passing. Before an avatar can communicatewith another avatar, it must connect itself to the avatar with which itwishes to communicate. This is done through a specified message, whichcan be named in any way. The connection is viewed as a tag inside thesoftware

When an avatar emits a message, all avatars listen to the message, butonly those avatars which are connected to the avatar emitting themessage will receive the message and process it.

Objects in the environment are made to move by building and linkingtogether chains of animations that get played out by each objectindividually. These animation chains can be cut and spliced together.

Instructions can be placed between the joins, which instructions canfire messages to other objects in the system. These messages only getfired after the animations that precede them get played out. This isreferred to as deferred message passing. Deferred message passing canforce a dynamic switch in the scene hierarchy.

1. Apparatus for controlling an interactive virtual environment, theapparatus comprising means for defining a virtual environment populatedby objects, the objects comprising at least avatars and props, wherein:objects within the virtual environment may be dynamically attached toand detached from other objects under user control; and a prop hasassociated with it an animation for use when an avatar interacts withthe prop, and when the prop is attached to another object the animationremains associated with the prop.
 2. Apparatus according to claim 1wherein, when an object is attached to another object, it inherits themovement of the object to which it is attached.
 3. Apparatus accordingto claim 1 or 2 further comprising means for storing an animationsequence for subsequent replay or editing.
 4. Apparatus according toclaim 1 or 2, being an apparatus for playing a computer game. 5.Apparatus for controlling an interactive virtual environment, theapparatus comprising: means for defining a virtual environment populatedby objects; means for allowing a user to control the virtual environmentto create an animation sequence; and means for storing an animationsequence for subsequent replay or editing; wherein objects within thevirtual environment may be dynamically attached to and detached fromother objects, and when an object is attached to another object itinherits the movement of the object to which it is attached. 6.Apparatus according to claim 5 wherein the objects comprise at leastavatars and props.
 7. Apparatus according to claim 6, wherein a prop hasassociated with it an animation for use when an avatar interacts withthe prop.
 8. Apparatus for controlling an interactive virtualenvironment, the apparatus comprising: means for defining a virtualenvironment populated by objects, the objects comprising at leastavatars and props; means for allowing a user to control the virtualenvironment to create an animation sequence; and means for storing ananimation sequence for subsequent replay or editing; wherein a prop hasassociated with it an animation for use when an avatar interacts withthe prop.
 9. Apparatus according to any of claims 1 to 4 or 7 or 8,wherein the prop has associated with it an animation defining themovement of the prop and an animation defining the movement of theavatar when the avatar interacts with the prop.
 10. Apparatus accordingto any of claims 1 to 4 or 7 to 9 wherein, when the avatar interactswith the prop, the avatar queries the prop for the avatar animationassociated with the prop.
 11. Apparatus according to any of claims 7 to10 wherein, when the prop is attached to another object, the associatedanimation or animations remain associated with the prop.
 12. Apparatusaccording to any of claims 1 to 4 or 7 to 11 wherein the animation oranimations are defined as part of a state machine which is associatedwith the prop.
 13. Apparatus according to claim 12 wherein the statemachine comprises a state transition which defines an initial state, afinal state, and at least one of a prop animation which takes the propfrom the initial state to the final state, and an avatar animation whichtakes the avatar from the initial state to the final state, andoptionally back to the initial state.
 14. Apparatus according to claim13 wherein a precondition is associated with one of the states. 15.Apparatus according to any of claims 12 to 14 wherein the state machinehas an idle state.
 16. Apparatus according to any of claims 3 or 5 to 15wherein an animation sequence is stored as a script comprising a list ofcommands.
 17. Apparatus according to claim 16 wherein the commands arethe same commands as may be entered by a user in order to control thevirtual environment.
 18. Apparatus according to claim 16 or 17 wherein ascript contains an instruction which is to be passed to an object in thevirtual environment.
 19. Apparatus according to claim 18 wherein theinstruction is only passed to the object once an animation whichprecedes it in the script has been played out.
 20. Apparatus accordingto any of the preceding claims, wherein an avatar comprises at least afile defining its appearance, and an animation defining its movements.21. Apparatus according to any of the preceding claims, wherein aplurality of avatars share a common animation.
 22. Apparatus accordingto claim 21 wherein the common animation is retargeted to fit the sizeof the avatar in question.
 23. Apparatus according to any of thepreceding claims, wherein a prop includes a file which specifies a wayin which the prop may contain other props.
 24. A method of controllingan interactive virtual environment, the method comprising defining avirtual environment populated by objects, the objects comprising atleast avatars and props, wherein: objects within the virtual environmentmay be dynamically attached to and detached from other objects underuser control; and a prop has associated with it an animation for usewhen the prop interacts with an avatar, and when the prop is attached toanother object the associated animation remains associated with theprop.
 25. A method of controlling an interactive virtual environment,the method comprising the steps of: defining a virtual environmentpopulated by objects, wherein objects may be dynamically attached to anddetached from other objects; allowing a user to control the virtualenvironment to create an animation sequence; and storing an animationsequence for subsequent replay or editing; wherein when an object isattached to another object it inherits the movement of the object towhich it is attached.
 26. A method of controlling an interactive virtualenvironment, the method comprising: defining a virtual environmentpopulated by objects, the objects comprising at least avatars and props;allowing a user to control the virtual environment to create ananimation sequence; storing an animation sequence for subsequent replayor editing; and associating with a prop an animation for use when anavatar interacts with the prop.
 27. A computer program which, when runon a computer, causes the computer to carry out the method of any ofclaims 24 to 26, or to become the apparatus according to any of claims 1to
 23. 28. A computer readable storage medium having stored thereon acomputer program which, when run on a computer, causes the computer tocarry out the method of any of claims 24 to 26, or to become theapparatus according to any of claims 1 to 23.